package com.keepsport.keepsportapi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.io.Serializable;

/**
 * 热门话题(TCommunityTopic)实体类
 *
 * @author makejava
 * @since 2022-07-01 18:47:53
 */
@Data
@NoArgsConstructor
@TableName("t_community_topic")
public class CommunityTopic implements Serializable {
    private static final long serialVersionUID = 872294628571496412L;
    /**
     * 序号
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 标题
     */
    private String title;
    /**
     * 热度
     */
    private Integer heat;
    /**
     * 内容
     */
    private String info;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date ctime;

    public CommunityTopic(String title, String info) {
        this.title = title;
        this.heat = 0;
        this.info = info;
        this.ctime = new Date();
    }
}

